<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- QCtmWindow.cpp -->
  <meta name="description" content="顶层自定义无边框窗口.">
  <title>QCtmWindow Class | QCustomUi 1.16.0</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li><a href="index.html" translate="no">QCustomUi 1.16.0</a></li>
<li><a href="qcustomui-module.html" translate="no">QCustomUi</a></li>
<li>QCtmWindow</li>
<li id="buildversion">QCustomUi 1.16.0 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3 id="toc">Contents</h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title" translate="no">QCtmWindow Class</h1>
<!-- $$$QCtmWindow-brief -->
<p>顶层自定义无边框窗口. <a href="#details">More...</a></p>
<!-- @@@QCtmWindow -->
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">  <span class="preprocessor">#include &lt;QCtmWindow.h&gt;</span></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> QWidget</td></tr>
</table></div>
<ul>
<li><a href="qctmwindow-members.html">List of all members, including inherited members</a></li>
</ul>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#QCtmWindow" translate="no">QCtmWindow</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#dtor.QCtmWindow" translate="no">~QCtmWindow</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#addMoveBar" translate="no">addMoveBar</a></b>(QWidget *<i>moveBar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#centralWidget" translate="no">centralWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenuBar *</td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#menuBar" translate="no">menuBar</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCtmNavigationBar *</td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#navigationBar" translate="no">navigationBar</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#removeMoveBar" translate="no">removeMoveBar</a></b>(QWidget *<i>moveBar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#setCentralWidget" translate="no">setCentralWidget</a></b>(QWidget *<i>widget</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#setMenuBar" translate="no">setMenuBar</a></b>(QMenuBar *<i>menuBar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#setNavigationBar" translate="no">setNavigationBar</a></b>(QCtmNavigationBar *<i>bar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#setStatusBar" translate="no">setStatusBar</a></b>(QStatusBar *<i>statusBar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#setTitleBar" translate="no">setTitleBar</a></b>(QCtmTitleBar *<i>titleBar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStatusBar *</td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#statusBar" translate="no">statusBar</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCtmTitleBar *</td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#titleBar" translate="no">titleBar</a></b>() const</td></tr>
</table></div>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#event" translate="no">event</a></b>(QEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#eventFilter" translate="no">eventFilter</a></b>(QObject *<i>watched</i>, QEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qctmwindow.html#nativeEvent" translate="no">nativeEvent</a></b>(const QByteArray &amp;<i>eventType</i>, void *<i>message</i>, qintptr *<i>result</i>) override</td></tr>
</table></div>
<!-- $$$QCtmWindow-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@QCtmWindow -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCtmWindow[overload1]$$$QCtmWindowQWidget* -->
<h3 class="fn" translate="no" id="QCtmWindow"><code class="details extra" translate="no">[explicit]</code> QCtmWindow::<span class="name">QCtmWindow</span>(<span class="type">QWidget</span> *<i>parent</i> = nullptr)</h3>
<p>构造函数 <i translate="no">parent</i>.</p>
<!-- @@@QCtmWindow -->
<!-- $$$~QCtmWindow[overload1]$$$~QCtmWindow -->
<h3 class="fn" translate="no" id="dtor.QCtmWindow"><code class="details extra" translate="no">[virtual noexcept]</code> QCtmWindow::<span class="name">~QCtmWindow</span>()</h3>
<p>析构函数.</p>
<!-- @@@~QCtmWindow -->
<!-- $$$addMoveBar[overload1]$$$addMoveBarQWidget* -->
<h3 class="fn" translate="no" id="addMoveBar"><span class="type">void</span> QCtmWindow::<span class="name">addMoveBar</span>(<span class="type">QWidget</span> *<i>moveBar</i>)</h3>
<p>添加移动窗口 <i translate="no">moveBar</i>, 移动窗口可通过鼠标拖动来拖动窗口.</p>
<div class="admonition note">
<p><b>Note: </b>移动窗口必须本身就是本窗口的子窗口.</p>
</div>
<p><b>See also </b><a href="qctmwindow.html#removeMoveBar" translate="no">removeMoveBar</a>.</p>
<!-- @@@addMoveBar -->
<!-- $$$centralWidget[overload1]$$$centralWidget -->
<h3 class="fn" translate="no" id="centralWidget"><span class="type">QWidget</span> *QCtmWindow::<span class="name">centralWidget</span>() const</h3>
<p>返回中央窗口, 中央窗口默认存在，当中央窗口不存在时返回nullptr.</p>
<p><b>See also </b><a href="qctmwindow.html#setCentralWidget" translate="no">setCentralWidget</a>.</p>
<!-- @@@centralWidget -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" translate="no" id="event"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">bool</span> QCtmWindow::<span class="name">event</span>(<span class="type"><a href="https://doc.qt.io/qt/qevent.html" translate="no">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qobject.html#event" translate="no">QObject::event</a>(QEvent *e).</p>
<!-- @@@event -->
<!-- $$$eventFilter[overload1]$$$eventFilterQObject*QEvent* -->
<h3 class="fn" translate="no" id="eventFilter"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">bool</span> QCtmWindow::<span class="name">eventFilter</span>(<span class="type"><a href="https://doc.qt.io/qt/qobject.html#QObject" translate="no">QObject</a></span> *<i>watched</i>, <span class="type"><a href="https://doc.qt.io/qt/qevent.html" translate="no">QEvent</a></span> *<i>event</i>)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qobject.html#eventFilter" translate="no">QObject::eventFilter</a>(QObject *watched, QEvent *event).</p>
<!-- @@@eventFilter -->
<!-- $$$menuBar[overload1]$$$menuBar -->
<h3 class="fn" translate="no" id="menuBar"><span class="type"><a href="https://doc.qt.io/qt/qmenubar.html" translate="no">QMenuBar</a></span> *QCtmWindow::<span class="name">menuBar</span>() const</h3>
<p>返回菜单栏, 如果菜单栏不存在，则自动创建并返回一个菜单栏对象.</p>
<p><b>See also </b><a href="qctmwindow.html#setMenuBar" translate="no">setMenuBar</a>.</p>
<!-- @@@menuBar -->
<!-- $$$nativeEvent[overload1]$$$nativeEventconstQByteArray&void*qintptr* -->
<h3 class="fn" translate="no" id="nativeEvent"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">bool</span> QCtmWindow::<span class="name">nativeEvent</span>(const <span class="type">QByteArray</span> &amp;<i>eventType</i>, <span class="type">void</span> *<i>message</i>, <span class="type"><a href="https://doc.qt.io/qt/qttypes.html#qintptr-typedef" translate="no">qintptr</a></span> *<i>result</i>)</h3>
<!-- @@@nativeEvent -->
<!-- $$$navigationBar[overload1]$$$navigationBar -->
<h3 class="fn" translate="no" id="navigationBar"><span class="type"><a href="qctmnavigationbar.html" translate="no">QCtmNavigationBar</a></span> *QCtmWindow::<span class="name">navigationBar</span>() const</h3>
<p>返回导航栏, 如果导航栏不存在，将自动创建一个新的导航栏对象并返回.</p>
<p><b>See also </b><a href="qctmwindow.html#setNavigationBar" translate="no">setNavigationBar</a>.</p>
<!-- @@@navigationBar -->
<!-- $$$removeMoveBar[overload1]$$$removeMoveBarQWidget* -->
<h3 class="fn" translate="no" id="removeMoveBar"><span class="type">void</span> QCtmWindow::<span class="name">removeMoveBar</span>(<span class="type">QWidget</span> *<i>moveBar</i>)</h3>
<p>移除移动窗口 <i translate="no">moveBar</i>.</p>
<p><b>See also </b><a href="qctmwindow.html#addMoveBar" translate="no">addMoveBar</a>.</p>
<!-- @@@removeMoveBar -->
<!-- $$$setCentralWidget[overload1]$$$setCentralWidgetQWidget* -->
<h3 class="fn" translate="no" id="setCentralWidget"><span class="type">void</span> QCtmWindow::<span class="name">setCentralWidget</span>(<span class="type">QWidget</span> *<i>widget</i>)</h3>
<p>设置中央窗口 <i translate="no">widget</i>, 当 <i translate="no">widget</i> 为nullptr时删除中央窗口.</p>
<p><b>See also </b><a href="qctmwindow.html#centralWidget" translate="no">centralWidget</a>.</p>
<!-- @@@setCentralWidget -->
<!-- $$$setMenuBar[overload1]$$$setMenuBarQMenuBar* -->
<h3 class="fn" translate="no" id="setMenuBar"><span class="type">void</span> QCtmWindow::<span class="name">setMenuBar</span>(<span class="type"><a href="https://doc.qt.io/qt/qmenubar.html" translate="no">QMenuBar</a></span> *<i>menuBar</i>)</h3>
<p>设置菜单栏 <i translate="no">menuBar</i>, 设为nullptr时，删除菜单栏.</p>
<p><b>See also </b><a href="qctmwindow.html#menuBar" translate="no">menuBar</a>.</p>
<!-- @@@setMenuBar -->
<!-- $$$setNavigationBar[overload1]$$$setNavigationBarQCtmNavigationBar* -->
<h3 class="fn" translate="no" id="setNavigationBar"><span class="type">void</span> QCtmWindow::<span class="name">setNavigationBar</span>(<span class="type"><a href="qctmnavigationbar.html" translate="no">QCtmNavigationBar</a></span> *<i>bar</i>)</h3>
<p>设置导航栏 <i translate="no">bar</i>, <i translate="no">bar</i> 为nullptr时删除导航栏.</p>
<p><b>See also </b><a href="qctmwindow.html#navigationBar" translate="no">navigationBar</a>.</p>
<!-- @@@setNavigationBar -->
<!-- $$$setStatusBar[overload1]$$$setStatusBarQStatusBar* -->
<h3 class="fn" translate="no" id="setStatusBar"><span class="type">void</span> QCtmWindow::<span class="name">setStatusBar</span>(<span class="type"><a href="https://doc.qt.io/qt/qstatusbar.html" translate="no">QStatusBar</a></span> *<i>statusBar</i>)</h3>
<p>设置状态栏 <i translate="no">statusBar</i>, 当设置 <a href="qctmwindow.html#statusBar" translate="no">statusBar</a> 为 nullptr 时将删除状态栏.</p>
<p><b>See also </b><a href="qctmwindow.html#statusBar" translate="no">statusBar</a>.</p>
<!-- @@@setStatusBar -->
<!-- $$$setTitleBar[overload1]$$$setTitleBarQCtmTitleBar* -->
<h3 class="fn" translate="no" id="setTitleBar"><span class="type">void</span> QCtmWindow::<span class="name">setTitleBar</span>(<span class="type"><a href="qctmtitlebar.html" translate="no">QCtmTitleBar</a></span> *<i>titleBar</i>)</h3>
<p>设置标题栏 <i translate="no">titleBar</i>, 当 <i translate="no">titleBar</i> 为 nullptr 时删除标题栏，如果删除标题栏后导航栏存在，则导航栏替代标题栏响应鼠标拖拽功能.</p>
<p><b>See also </b><a href="qctmwindow.html#titleBar" translate="no">titleBar</a>.</p>
<!-- @@@setTitleBar -->
<!-- $$$statusBar[overload1]$$$statusBar -->
<h3 class="fn" translate="no" id="statusBar"><span class="type"><a href="https://doc.qt.io/qt/qstatusbar.html" translate="no">QStatusBar</a></span> *QCtmWindow::<span class="name">statusBar</span>() const</h3>
<p>返回状态栏，如果状态栏对象不存在，<a href="qctmwindow.html" translate="no">QCtmWindow</a>会自动创建一个状态栏对象返回.</p>
<p><b>See also </b><a href="qctmwindow.html#setStatusBar" translate="no">setStatusBar</a>.</p>
<!-- @@@statusBar -->
<!-- $$$titleBar[overload1]$$$titleBar -->
<h3 class="fn" translate="no" id="titleBar"><span class="type"><a href="qctmtitlebar.html" translate="no">QCtmTitleBar</a></span> *QCtmWindow::<span class="name">titleBar</span>() const</h3>
<p>返回标题栏，当标题栏不存在时自动创建并返回标题栏.</p>
<p><b>See also </b><a href="qctmwindow.html#setTitleBar" translate="no">setTitleBar</a>.</p>
<!-- @@@titleBar -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> QCustomUi
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/> </div>
</body>
</html>
